<!DOCTYPE html>
<html>
<head th:include="include :: header"></head>
<body class="layui-bg-white">
<div class="layui-form" style="padding:20px;">
    <input id="id" name="id" th:value="${task.id}" type="hidden">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>任务名称：</label>
        <div class="layui-input-block">
            <input type="text" name="jobName" lay-verify="required" placeholder="请输入任务名称" autocomplete="off" class="layui-input" th:value="${task.jobName}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>任务分组：</label>
        <div class="layui-input-block">
            <input type="text" name="jobGroup" lay-verify="required" placeholder="请输入任务分组" autocomplete="off" class="layui-input" th:value="${task.jobGroup}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>任务类：</label>
        <div class="layui-input-block">
            <input type="text" name="beanClass" lay-verify="required" placeholder="请输入任务类" autocomplete="off" class="layui-input" th:value="${task.beanClass}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">CORN表达式：</label>
        <div class="layui-input-block">
            <input type="text" name="cron" placeholder="请输入CORN表达式" autocomplete="off" class="layui-input" th:value="${task.cron}">
        </div>
    </div>
    <div class="layui-row layui-form-item">
        <div class="layui-col-md6">
            <label class="layui-form-label">任务状态：</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-skin="switch" lay-filter="switchState" lay-text="开启|关闭" th:checked="${task.jobStatus=='1'?true:false}">
                <input type="hidden" name="jobStatus" id="state" th:value="${task.jobStatus}">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">任务描述：</label>
        <div class="layui-input-block">
            <input type="text" name="description" placeholder="请输入任务描述" autocomplete="off" class="layui-input" th:value="${task.description}">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-operate-submit" id="LAY-operate-submit" value="确认">
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript">
    layui.config({
        base: ctx + '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index'         //主入口模块
    }).use(['index', 'form'], function () {
        var $ = layui.$, form = layui.form;

        form.on('switch(switchState)', function (data) {
            if (data.elem.checked == true) {
                $('#state').val('1');
            } else {
                $('#state').val('0');
            }
        });

        form.verify(commonJs.form.verify);
    })
</script>
</body>
</html>


